<template>
    <div class="correlation-analysis">
        <title-bar title="关联规则结果表"></title-bar>
        <vxe-table ref="xTable" border show-header-overflow height="400">
            <vxe-table-column show-overflow v-for="(item, index) in tableData.columns" :key="index" :field="item" :title="item"></vxe-table-column>
        </vxe-table>
    </div>
</template>
<script>
import TitleBar from '@/components/TitleBar'
import {
    mapGetters
} from 'vuex'
export default {
    name: 'CorrelationAnalysis',
    components: {
        TitleBar
    },
    computed: {
        ...mapGetters({
            analysisReportData: 'common/getAnalysisReportData'
        })
    },
    data () {
        return {
            tableData: {
                rows: [],
                columns: []
            }
        }
    },
    created () {
        this.init()
    },
    methods: {
        init () {
            this.tableData = this.analysisReportData.content.summaryReports
            this.$nextTick(() => {
                this.$refs.xTable.loadData(this.tableData.rows)
            })
        }
    }
}
</script>
